package com.huxin.servelt.admin;


import com.alibaba.fastjson.JSON;
import com.huxin.pojo.BookHisInfo;
import com.huxin.pojo.BooksInfo;
import com.huxin.service.Userservice;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/admin/updateBookHisInfoByHid")
public class AdminUpdateBookHisInfoByHidServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String s = req.getReader().readLine();
        BookHisInfo bookHisInfo = JSON.parseObject(s, BookHisInfo.class);
        Userservice userservice = new Userservice();
        int i=userservice.updateBookHisInfoEndTimeByHid(bookHisInfo);
        resp.getWriter().write(String.valueOf(i));

    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doPost(req, resp);
    }
}
